Top 10k strings from Make-a-Chip (1984)(Sinclair Research).tap
in <root> / bin / z80 / software / Sinclair Spectrum Collection TOSEC.exe / Sinclair ZX Spectrum - Utilities & Educational / Sinclair ZX Spectrum - Utilities & Educational - [TAP] (TOSEC-v2007-01-01) /
Back to the directory listing
6 MAKE A CHIP 5 n7,n8;" "; 5 n7,n7;"0"; 5 n5,n3;" "; 5 n4,n8;" "; 5 n4,n7;"1"; 5 n2,n2;" "; 5 e$(n2)="1": 5 e$(n2)="0" 5 e$(n1)="1": 5 e$(n1)="0" 4 y1+n1,x1;" ": 4 n7,n8;"0": 4 n5,n3;"0"; 4 n4,n8;"0": 4 e$(n4)="1": 4 e$(n4)="0" 4 e$(n3)="1": 4 e$(n3)="0" 3 n7,n7;"1"; 3 n4,n7;"0"; 3 n3*n7,n;" "; 3 n2,n2;"1": 3 n2,n2;"0": 3 "'" 2 v=g(t,n2)-n8-n8: 2 to continue, or 2 t=f(f,n1): 2 st=fob+s1-n1: 2 s=o(o,n1): 2 q=g(s,n1): 2 p=g(s,n2): 2 n9,n8;"1"; 2 n9,n8;"0"; 2 n9,n5*n5;"0 0"; 2 n9,n0+n5;"1"; 2 n7,n8;"1": 2 n7,n7;" "; 2 n7,n0+n5;"1"; 2 n6*n2,n8;"1"; 2 n6*n2,n8;"0"; 2 n5;"in <-----gates----> out 2 n5,n3;"1"; 2 n4,n8;"1": 2 n4,n7;" "; 2 n3,n0+n5;"1"; 2 n0+n1,n;"1"; 2 n0+n1,n;"0"; 2 n$(n1)="s" 2 n$(n1)="Y" 2 n$(n1)="S" 2 m(cx-n1,cy,n1)=g: 2 m(cx-n1,cy,n1) 2 l(in)=l(in)+n1: 2 YT,XT;" "; 2 YT+N1,XT;" " 2 Y1,X1;" "; 2 Y1+N1,X1;" "; 2 ;"OFF | OFF"' 2 " ",-n8-n8: 2 1 y1,x1;" "; 1 y1+n1,x1;" " 1 y+n1,x;g$(n3 1 y+N1,x;" " 1 v=g(t,n1): 1 v=g(t,n1)+pt: 1 v=g(S,n2): 1 v=g(S,n1): 1 truth table 1 t>n3*n4)+(n4 1 t=o+n4*n4: 1 t=n0+n6+o: 1 t1<n0+n7)+( 1 t(i1)-p,n: 1 st=fib+n8*(-n1+ 1 st=ffb+n8: 1 st=ffb+n8+n8: 1 st=fbb+n8: 1 st=fbb+n8+n8: 1 select output lines 1 s>n0+n2)+(n4 1 s=m(j,k,n3): 1 s=m(j,k,n2): 1 s=f(f,n3): 1 s=f(f,n2): 1 s$(n9,n4): 1 s$(n7)="OUT": 1 s$(n6)="STOP": 1 s$(n5)="NOR": 1 s$(n4)="NAND": 1 s$(n3)="NOT": 1 s$(n2)="OR": 1 s$(n1)="AND": 1 q=g(T,n1)+PT: 1 pt=+n4-(n2 1 p=g(T,n2)-16 1 p3=fnc+n3: 1 p3,m(j,k,n1) 1 p+n8,q-n7,n2 1 p+n6,q-n7: 1 p(o)=o(o,n2));("Your guess was wrong" 1 out=m(x2-N1,y2,n5): 1 out=m(x,y,n5): 1 o(o,n2)=out 1 o(o,n2));". ": 1 o(o,n1)=in: 1 n9,n;"When we draw logic gates across the screen we work out their function from left to right."''"The computer works out each column of gates in one very small interval of time." 1 n9,n;"When input S is set, the output Q is set on, and is fed back as signal P for the next cycle. Further cycles will leave Q on until the input R is set, at which time Q is reset to zero (and fed back as P). This will continue until S is set again. Sand R can't both be set together- but assume in the truth table that such situations set Q to zero." 1 n9,n;"Watch what happens to the outputof each gate for each set of input values. Note how the same values occur at both outputs." 1 n9,n;" ________": 1 n9,n;" S R P Q"; 1 n9,n3*n5;"1"; 1 n9,n3*n5;"0"; 1 n9,n3*n0;"0": 1 n9+n9,n;"Please wait while I check your circuit is valid.": 1 n9+n9,n;"Now I shall calculate the outputvalues." 1 n8,n5*n5;"in out"; 1 n8,n5*n5;"_______"; 1 n8,n1;in2: 1 n8,n1;" "; 1 n7,n7+n7;" ": 1 n7,n1;" "; 1 n7,n0+n5;"0"; 1 n7+n7,n;"Watch what happens with various sets of inputs." 1 n7*n3,n;"select the next input. ": 1 n6;"MAKE A CHIP": 1 n6,n5*n5;"1 1": 1 n6,n1;in1: 1 n6,n1;" "; 1 n6,n0+n4;"| |"; 1 n6*n2,n5*n5;"1 1": 1 n6*n2,n3*n0;"1": 1 n5,n5*n5;"in out": 1 n5,n5*n5;"1 0"; 1 n4;" "'" ": 1 n4,n;"switch1"; 1 n4,n;"switch"; 1 n4,n;"S"''"R"; 1 n4,n5*n5;"0 1"; 1 n4,n4+n0;"| |"; 1 n3,n;"ignition"; 1 n3,n5*n5;"table"; 1 n3,n5*n5;"0 0"; 1 n3,n0+n5;"0"; 1 n3,n0+n1;" 1 n2,n5*n5;"in out"; 1 n2,n5*n5;"_______"; 1 n2,n5*n5;"Truth"; 1 n1;p+n8,q-n7,n2 1 n1;p+n6,q-n7: 1 n1;"_____________________________"; 1 n1;"Answer 8" 1 n1/n2,-n0: 1 n0,n;"switch2" 1 n0,n;"reversing"; 1 n0,n;"Now we will see that a NOR gate is really the same as an OR gateand a NOT gate in series." 1 n0,n;"Next, look what happens to the NAND gate when both inputs are the same.": 1 n0,n;" 0 0 0"'" 0 1 0"'" 1 0 0"'" 1 1 0 0"'" 0 0 1"'" 0 1 1"'" 1 0 1"'" 1 1 1 0" 1 n0,n5*n5;"0 1"; 1 n0,n3*n0;"1": 1 n0,n2;"Turn your tape recorder off." 1 n0+n9,n;"Output ";o;" will have value ?": 1 n0+n9,n;"Output ";o;" was ";o(o,n2)'("You guessed correctly" 1 n0+n9,n5*n5;ip: 1 n0+n7,n;"Would you like to give the inputs new values? Type I to set the inputs, or S to stop." 1 n0+n7,n;"Would you like to give the inputs new values? Type I to set the inputs or C to continue." 1 n0+n7,n;"Type A to amend the circuit, R to set inputs & run, L to learn about gates, E to see example circuits, S to stop." 1 n0+n7,n;"There is no gate here although you are using an output from this position. Please edit thiscircuit to make it correct.": 1 n0+n7,n;"There is a feedback line betweenthese gates. This could make the ciruit be undetermined for certain input values. ": 1 n0+n7,n;"Do you want me to print a copy of the circuit on ZX Printer? Type C for a copy, or type N forthe next set of input values."; 1 n0+n7,n;"Do you recognise the output pattern? This circuit is how anOR gate is made up of NAND gates": 1 n0+n7,N;"Type F to try another set of initial feedback values, type I to try another set of inputs or type S to STOP." 1 n0+n7,N;"I shall select a set of inputs": 1 n0+n1,n;"light switch" 1 n0+n1,n5*n5;"1 0"; 1 n0+n1,n3*n0;"1": 1 n$(n1)="y") 1 n$(n1)="y" 1 more i/p etc then mode 1 1 means the light is waiting to be set.": 1 m(x,y,n1)>n 1 m(x,y,n1)=n 1 m(n3,n4,n5): 1 m(k,j,n3)=n 1 m(k,j,n3)=in: 1 m(k,j,n2)=n 1 m(k,j,n2)=in: 1 m(k,j,n1)=n3): 1 m(k,j,n1)=n 1 m(j,k,n1)=n3 1 m(i,j,n4)=m(i,j,n5): 1 m(gx,gy,n3)=in2: 1 m(gx,gy,n2)=in1: 1 m(cx-n1,cy,n4)=iP: 1 m(J,cy,n5)=out 1 m(J,cy,n1)=n 1 logic elements 1 l(in2)=l(in2)+n1 1 l(in1)=l(in1)+1 1 k,n;i(i);" "'" " 1 k,n;i(i);" " 1 j(n3,n1)=n1: 1 j(n2,n1)=n1: 1 j(n1,n1)=J 1 j(j,n3)=n4: 1 j(j,n3)=n3: 1 j(j,n3)=n2: 1 j(j,n3)=n1: 1 j(j,n2)=n7: 1 j(j,n2)=n2: 1 j(j,n2)=n0: 1 j(j,n2)=15 1 ip1=wt+n0: 1 in=on)+(lf 1 in=off)+(lf 1 in2=on)+(lf 1 in2=m(x2-n1,y2,n5): 1 in2=m(x2-n1,y2,n4): 1 in2=i(y2): 1 in1=on)+(lf 1 in1=m(x2-n1,y2,n5): 1 in1=m(x2-n1,y2,n4): 1 in1=i(y2): 1 g=m(j,k,n1): 1 for OFF 1 fnz=fny+n3: 1 fny=fnx+n3: 1 fnx=bt+n3: 1 fnc=fnz+n3: 1 ffb=n5*n5: 1 f(n1,n1)=n 1 f(n0+n2,n3) 1 f(f,n2)=s: 1 f(f,n1)=t: 1 cy=n4)+(cy+n1 1 cy=n3)+(n3*n5 1 cy=n2)+(n0 1 cy=n1)+(n7 1 cy=n1)+(cy-n1 1 cx=xl)+(cx-n1 1 cx=xh)+(cx+n1 1 cx=n4)+(n3*n0 1 cx=n3)+(22 1 cx=n2)+(n5*n3 1 cx=n1)+(n8 1 c(nx)=c(nx)+(n1 1 c(n4)=n5*n5: 1 c(n3)=n0+n7: 1 b,A;"SAVING - do not turn tape off ": 1 a$(n1)="C" 1 ___________ 1 Where do you want to start? 1 ST=ST+H-N1: 1 S$(N9)="NEW" 1 S$(N8)="COPY": 1 Please wait while I load"; 1 Please press any key to continue 1 PART 5 1 PART 4 1 PART 3 1 PART 2 1 N9,N;"In the first part we learnt thata NAND gate is really an AND gate followed by a NOT gate. Theabove circuit shows two outputs,one from a NAND gate, the other from a sequence of gates." 1 N3,N;"In the first part of the programyou learnt about gates - what they are called and under what conditions they are ON or OFF."''"In this part of the program we shall see how to join gates to make circuits, and what FEEDBACKis."''"The third part of the program iswhere you design your own circuits." 1 N1;"?";IP: 1 M(CX-N1,CY,N1) 1 LST=-n1+n2^LT: 1 J(n4,N1)=n1: 1 J(J,N2),N;J(J,N1) 1 J(J,N1)=N: 1 I=M(J,K,n3): 1 I=M(J,K,n2): 1 I(J(J,N3))=J(J,N1): 1 F(N0+N2,N3): 1 Do you want to set any more outputs? Answer 1 Do you want to edit the circuit? 1 Do you want sound? Answer 1 Computer hardware is essentiallyquite simple,and can be thought of as five connecting elements." 1 CHIP 1 B(H+N8+N8)=N) 1 B$(S,N3)-N8: 1 B$(S,N3)-N8-N8: 1 B$(S,N2)-N8: 1 B$(S,N2)+N8: 1 B$(S,N1)+N8: 1 B$(S,N1)+N8+n8: 1 B$(N4*N4,N3): 1 B$(I)="000": 1 AND OR NOT NANDNOR STOPOUT COPYNEW 1 ;"two values and the"; 1 ;"the truth table." 1 ;"reversing"; 1 ;"previous cycle." 1 ;"is a SET/RESET"; 1 ;"in <-----gates----> out": 1 ;"carry, which is a"; 1 ;"bistable." 1 ;"We could use an OR gate for a light which has two switches. The light would be on if EITHER switch 1 OR switch 2 is on." 1 ;"Type 1 for the computer to try each set of inputs in turn, or type 2 (or 3) to try particular sets of inputs. Type 1 ;"This circuit "; 1 ;"ON | ON" 1 ;"ON | OFF"' 1 ;"Now let's complete"; 1 ;"In each cycle of our"; 1 ;"I am drawing the connexion" 1 ;"'add machine', we add"; 1 3 to guessthe output for your input values" 1 000000000000000000000000000000000000000000000000L 1 .A signal high represents 1, and low represents 0. 1 ."''"Feedback is a means of modifyingthe input to one gate as a result of a previous output fromanother gate,each gate being setduring a time cycle." 1 . When the NOT is after the OR gate we call it a 1 . This is an OR gate followed by a NOT gate."''"Try and complete the truth tableby setting the inputs to the gate. 1 ,n;"ignition 1 ,n;"carry 1": 1 ,n;"Where do you want the lines intothe outputs to come from? First select an output, by usingcursor controls and then press enter.": 1 ,n;"What do you think the outputs will be?" 1 ,n;"We will put a light at each of the inputs and outputs to see what happens when different logic values are input." 1 ,n;"We shall now look at a gate withonly one input. The output is always the opposite of the input. We call this a 1 ,n;"This is how a NAND gate is drawnNow try and complete the truth table.": 1 ,n;"This gate has no output, this however is not an error but is aspare circuit. You may editthiscircuit to correct this fault." 1 ,n;"The symbol on the screen is called an AND gate, and is how we represent a logic AND in circuit drawings. The circuit will put the light (or output) ON if both inputs are set to ON." 1 ,n;"The last gate we shall look at is called 1 ,n;"So we need to set an initial value for the output of the source gate." 1 ,n;"Set the inputs to the AND gate to see what values turn the reversing light ON."''"The computer will fill in a row in the truth table for each set of inputs you try.": 1 ,n;"Please wait while I remember anddraw your circuit." 1 ,n;"Now set the inputs and see what happens to the output and to thetruth table." 1 ,n;"Do you recognise the pattern of the truth table?";: 1 ,n;"Another type of gate is called an 1 ,n0;"add bigger numbers...": 1 ,n0;"That was fairly easy."; 1 ,n0;"Now we shall try to"; 1 ,n0;" with no carry."; 1 ,n0;" 5 plus 8 is 3 carry 1"; 1 ,n0;" 1 plus 1 (carry) is 2"; 1 ,N;"Type R to run the circuit, C to continue design, L to learn about gates, E to see the examples."; 1 ,N;"Type QUIT to leave this part of the program." 1 , as shown next.": 1 , and eight bits are referred to as a byte. 1 ))/n2^n0)/n0;"K" 1 ''"You have now learnt about the basic elements used in circuit design. The next part of the program enables you to combine gates and to see what happens with a selection of different input values." 1 ''"When the NOT gate is immediatelyafter the AND gate we call it a 1 ''"These elements can be made from just one type of electronic circuit.The complex part of the computer being how these circuits are joined together." 1 ''"The next page shows a picture ofthe way a computer is made up ofthe five elements." 1 ''"The electric signals in the computer are either 1 ''"Process is a way of saying 'work'. The computer will work with the information held in itsmemory or the information that you have 'input'. There must bean 'output' so the computer can tell you what it has worked out.The control looks after what the computer is doing." 1 ''"Now select the values for the inputs to the circuit." 1 ''"NAND and NOR gates are very easyto construct and all other gatescan be made by combining NAND gates." 1 ''"Do you want to continue with your old circuit or to start a new design?"''"Type O for your old circuit or N for a new circuit." 1 ''"Another example of a circuit with feedback is a BISTABLE. These can be used for registers and store in computers. They canhold, for another cycle, the previous output of a gate.": 1 ''"A binary digit is called 1 '"You can not position a gate here! Try again.": 1 '"We will record the input and output combinations in a 1 '"To move the cursor use keys 5-8.When you press enter you will beable to specify the type of gateor enter a command." 1 '"To explain this, think of addingtwo numbers.": 1 '"There are three basic logic"'"elements. They are called 1 '"The first part of this program tells you about circuit design. The second part shows you some example circuits. The third partlets you experiment and design circuits."''"If you have not run the program before, you should start with the first part." 1 '"If you 'BREAK' into the program,you should not type RUN as this will lose the data. Type GOTO 1instead." 1 '"Consider a car with a reversing light. For the reversing light to be on, the reversing light switch must be on whilst the ignition is on.In logic circuitswe can say the light will be ON when the ignition is ON 1 '"A truth table usually has 1 and 0 instead of ON and OFF." 1 "You have missed out an input to this gate, where should it come from?": 1 "You already have a gate here! You can only change the gate to one with the SAME number of inputs.": 1 "Where should the output come from? Use cursor controls to select the position, then press enter." 1 "What type of gate do you want tofind out about?"''" AND 1 "We are now going to find out about 1 "Type your command: ";a$: 1 "Type the gate name ";g$: 1 "Type STOP to stop design COPY tO print circuit OUT to set outputs NEW to start again, or AND OR NOT NAND NOR for gate." 1 "This output is already being used. Remember there can only beone line into an output.": 1 "Sometimes we wish to use a NOT gate just after an AND or an OR gate. To do this we just draw the small circle from the NOT gate where we wish the NOT gate to go." 1 "Select where the inputs to this gate come from. Position the cursor where the input is from, or at one of the outputs if you are unsure." 1 "R, C, L or E :";a$: 1 "Part 1 (learn), 2 (examples), 3 (experiment) or 4(STOP)";n$: 1 "O or N :";a$: 1 "Information is represented in a computer as a list of 1's and 0's. This type of representationis called binary. Binary is used a lot in computing because electronic circuits can only be ON or OFF." 1 "In this section we have seen howto make a circuit from gates. Inreality you would do this with transistors, chips, bits of wireand solder."''"We have also seen how all the gates can be constructed by combining just one type of gate."''"Lastly we have looked at how we can make storage by using feed- back." 1 "In this part you can experiment with the gates and try to createyour own circuits."''"You may use any of the gates - AND, OR, NOT, NOR and NAND. Youhave a command COPY which will copy your circuit to the ZX Printer if it is connected. A command OUT allows you to set up to 4 outputs. STOP will stopthe design part, I will then check the circuit is valid, and will work out the output for anyinput combination you select."''"Have fun!": 1 "In part 1, we said all gates canbe made from a combination of NAND gates. We shall now see howwe can make an OR gate." 1 "I or S: ";a$: 1 "I or C: ";a$: 1 "F, I or S :";a$ 1 "Electronic circuits contain"'"transistors. Common arrangementsof transistors are represented"'"symbolically by 1 "C (Copy) or N (Next inputs) ";a$: 1 "A, S, R, L or E :";a$: 1 "1, 2 or 3 :";a$: 1 "''" OR 1 "''" NOT 1 " The output is"'"equivalent to the output from a NOT gate. So we can make NOT gates from NAND gates - and alsowe can make AND gates (NAND thena NOT gate).": 1 the reversing light switch is ON. 1 switch | light"; 1 means the light is on"''" 1 means the light is off"''" 1 in circuit diagrams. 1 from the"; 1 for ON, and 1 CONTROL 1 PROCESS 1 MEMORY 1 NOR 1 NAND